﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace _09RectangleInCircle
{
    class _09RectangleInCircle
    {
        static void Main(string[] args)
        {
            Console.WriteLine("This is a program that will check if a given point\n(x, y) is within the circle K((1,1), 3)\nand out of the rectangle((-1,1),(5,1),(-1,-1),(5,-1)).");
            Console.WriteLine("Enter value for x:");
            double x = double.Parse(Console.ReadLine());
            Console.WriteLine("Enter value for y:");
            double y = double.Parse(Console.ReadLine());
            double hypotenuse = Math.Sqrt(Math.Pow(x - 1, 2) + Math.Pow(y - 1, 2));
            bool outRectangle = !((x >= -1) && (x <= 5) && (y <= 1) && (y >= -1));
            bool inCircle = hypotenuse <= 3;
            bool check = outRectangle && inCircle;
            Console.WriteLine(check ? "The point is within the circle and outside the rectangle." : "The point does not meet the two condtions.");

        }
    }
}
